#pragma once
#include "RBTree.h"


namespace My
{
	template<class K>
	class set
	{
	public:
		struct MyKeyOfV
		{
			const K& operator() (const K& key)
			{
				return key;
			}
		};
		void insert(const K& key)
		{
			_t.Insert(key);
		}
		typedef typename RBTree<K, const K, MyKeyOfV>::Iterator iterator;
		iterator begin()
		{
			return _t.Begin();
		}
		iterator end()
		{
			return _t.End();
		}
	private:
		RBTree<K, const K, MyKeyOfV> _t;
	};
	void test_Myset()
	{
		set<int> s;
		s.insert(1);
		s.insert(2);
		s.insert(5);
		s.insert(3);
		s.insert(4);
		for (auto e : s)
		{
			cout << e << " ";
		}
		cout << endl;


	}
}